package com.atguigu.orderservice.client;

import com.atguigu.commonutils.coursevo.CourseInfoVo;
import com.atguigu.commonutils.ordervo.CourseWebVoOrder;
import feign.hystrix.FallbackFactory;
import org.springframework.stereotype.Component;

@Component
public class EduClientFallbackFactory implements FallbackFactory<EduClientService> {

    //出错之后会执行
    @Override
    public EduClientService create(Throwable throwable) {
        StackTraceElement[] st_tr = throwable.getStackTrace();
        System.err.println("st_tr[0].toString()" + st_tr[0].toString());
        return new EduClientService() {
            @Override
            public CourseInfoVo getCourseInfoOrder(String id) {
                return null;
            }
        };
    }
}
